import 'package:city_corner/providers/main-page/filter-panel/index.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'house-list/index.dart';
import 'filter-panel/index.dart';
import 'search-panel/index.dart';

class MainPage extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => _MageState();
}

class _MageState extends State<MainPage> {
  @override
  void initState() {
    Provider.of<FilterModel>(context, listen: false).location = '4401';
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return ChangeNotifierProvider<FilterModel>(
        create: (context) => FilterModel(),
        child: Builder(builder: (context) {
          return Column(children: [
            SearchPanel(),
            FilterBar(),
            Expanded(
              child: HouseList(),
            )
          ]);
        }));
  }
}
